registerJQueryFunction(function(selector){

        /**
         * Handle the horizontal accordion layout.
         */
        selector('[ui-role=horizontal-accordion]').each(function(){
                var accordion=$(this);
                var minimizedWidth=accordion.attr('minimized-width-pr') || 0;
                var accordionPanels=function(){
                    return accordion.children();
                };
                var panels=accordionPanels();
                for(i in panels){
                    $(panels[i]).click(function(){
                            var me=this;
                            var otherPanels=accordionPanels().filter(function(){return this!=me;});
                            otherPanels.animate({width:minimizedWidth.toString()+'%'},500);
                            $(this).animate({width:(100-otherPanels.length*minimizedWidth).toString()+'%'});
                    });
                }
        });
});
